﻿<!--{inc(header.view.html)}-->

<div class="header">    
  
                       <div class="nav">
	                                 <ul id="nav_list">
                                                 <li><a href="index.php?app=vote&act=index" target="mainframe">投票列表</a></li> 
												 <li><a href="index.php?app=vote&act=add" target="mainframe">创建投票</a></li> 
                                                 <li><a  href="#" class="nav_icon"  target="mainframe">修改投票</a></li>                                     



	                                 </ul>
                       </div>
                
</div>



<div id="content">
                   <h1>修改投票</h1>

                  <div>
                                    <div class="tips_show"><img  src="{$web_view_dir}style/images/light.gif" align="absmiddle" /> <b>提示: </b>
                                                                  <span ></span>
                                    </div>


                                 
                                 
<table width="100%" border="0" cellspacing="1" cellpadding="3" class="table_style">
  <form name="form1" method="post" action="?app=vote&act=editpost">
    <tr class="head"> 
      <td colspan="2" height="23">修改投票</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="16%">投票项目名称: </td>
      <td width="84%"> 
        <input type="text" name="data[name]" value="{$data.name}" size="40">
      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="16%">投票类型:</td>
      <td width="84%"> 
        <phpscup:form type='radio' value='单选:1|多选:2' name='data[type]'  appname='vote'  />	  
      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="16%">是否做时间限制:<br>
        不做限制请留空,否则请输入限制每次投票的时间间隔</td>
      <td width="84%"> 
	  <input type="text" name="data[limittime]" value="{$data.limittime}" size="10"> 
  
        单位分钟 </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="16%">是否限制IP重复投票:</td>
      <td width="84%"> 
	   <phpscup:form type='radio' value='限制:1|不限制:0' name='data[limitip]'  appname='vote'  />
      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="16%">是否禁止游客投票:</td>
      <td width="84%"> 
	   <phpscup:form type='radio' value='限制:1|不限制:0' name='data[forbidguestvote]'  appname='vote'  />
      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="16%">投票的时间期限:<br>
        (留空不做限制)</td>
      <td width="84%">开始日期: 
	  <phpscup:form type='time' size='10' name='data[begintime]'  appname='vote'   />	
        格式:2007-02-02 12:12:23<br>
        结束日期: 
		<phpscup:form type='time' size='10' name='data[endtime]'  appname='vote'   />
        格式:2007-02-02 12:12:23 </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td> 投票描述:</td>
      <td> 
        <textarea name="data[about]" cols="60" rows="5">{$data.about}</textarea>
      </td>
    </tr>
	
    <tr bgcolor="#FFFFFF">
      <td>投票类型:</td>
      <td>
        <input type="radio" name="data[votetype]" value="0" onclick="choosetpl('0')" {$votetype[0]}>
        普通投票 
        <input type="radio" name="data[votetype]" value="1" onclick="choosetpl('1')" {$votetype[1]}>
        人物/图片展示投票
        <input type="radio" name="data[votetype]" value="2" onclick="choosetpl('2')" {$votetype[2]}>
        PK投票<br>
        <textarea name="data[votetpl]" id="votetpl" cols="70" rows="5">{$data[tplcode]}</textarea>
      </td>
    </tr>	
	
    <tr bgcolor="#FFFFFF"> 
      <td colspan="2">投票选项 
        <input type="text" name="textfield" value="1" size="5" id="addnum">
        <input type="button" name="Submit3" value="再增加几项" onclick="addvote();">
        <input type="hidden" name="hiddenField" value="{$nums}" id="num_s">
      </td>
    </tr>
 <SCRIPT LANGUAGE="JavaScript">
<!--
function UPF_upfile(url,b)
{
	document.getElementById(b).value=url;
}
//-->
</SCRIPT>
 
    <tr bgcolor="#FFFFFF"> 
      <td colspan="2"> 
        <?php foreach($listdb as $_key => $_value ) { ?>
<?php
if(!isset( $data.$_key.img ))
{
$data.$_key.img = "";
}
if(!isset( $edit ))
{
$edit ="";
}
if(!isset($data.id))
{
$data.id="";
}
?> 		
	    第1项 标题: 
        <input type="text" name="data[{$_key}][title]" value="{$_value[title]}" > 票数:<input type="text" name="data[{$_key}][votenum]" size="10" value="{$_value[votenum]}"  >
		描述:<input type="text" name="data[{$_key}][describes]" size="5" value="{$_value[describes]}">链接:<input type="text" name="data[{$_key}][url]" size="5" value="{$_value[url]}">   
		<br>
        图片: <input type="text"  value="{$data[$_key][img]}"  name="data[{$_key}][img]"  size="40"   id="UP_{$_key}.img"><br/>
 <iframe name="MF_{$_key}.img"  frameborder=""  height="150"  scrolling="no"  width="370"  src="?app=vote&act=upfile&tf=pic&jsfun=UPF_upfile&putid=UP_{$_key}.img&id={$data.id}&picurl={$data[$_key][img]}<?php if ( $edit =="editp") { ?>&edit=editp<?php } else { ?>&edit=edit<?php } ?>" ></iframe> 
       <input type="hidden" name="data[{$_key}][id]" value="{$_value[id]}">
        <input type="hidden" name="hiddenField" value="<a href='{SITE_URL}/?app=vote&act=vote&voteId={$_value[id]}' target='_blank'>投票</a>" id="ja_{$_value[id]}">
        <input type="hidden" name="hiddenField" value="<SCRIPT LANGUAGE='JavaScript' src='{SITE_URL}/?app=vote&act=shownum&id={$_value[id]}'></SCRIPT>" id="jb_{$_value[id]}">
        <a href="?app=vote&act=delvote&id={$_value[id]}">删除</a>&nbsp;&nbsp;
        <a href="#" onClick="JM_cc('ja_{$_value[id]}');alert('代码复制成功，你可以粘贴在网页里需要显示的地方,即可让用户给<{$_value[title]}>投票！')">按钮代码</a>&nbsp;&nbsp; 
        <a href="#" onClick="JM_cc('jb_{$_value[id]}');alert('代码复制成功，你可以粘贴在网页里需要显示的地方,即可显示<{$_value[title]}>的总票数！')">票数代码</a>       
	   <br>
       <?php } ?>	   

        <div id="morevote"></div>
      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td colspan="2" align="center"> 
        <input type="hidden" name="cid" value="{$cid}">
        <input type="submit" name="Submit" value="提 交">

      </td>
    </tr>
  </form>
</table>
<SCRIPT LANGUAGE="JavaScript">
<!--
function addvote(){
	var str='';
	
	num=document.getElementById('addnum').value;
	num=parseInt(num);
	n=document.getElementById('num_s').value;
	document.getElementById('num_s').value=num+parseInt(n);
	min=parseInt(n)+1;
	max=parseInt(n)+num+1;
	for(var i=min;i<max;i++){
		str+='<br>第'+i+'项 标题:<input type="text" name="data['+i+'][title]"> 票数:<input type="text" name="data['+i+'][votenum]" size="10">描述:<input type="text" name="data['+i+'][describes]" size="5" value="">链接:<input type="text" name="votedb['+i+'][url]" size="5" value=""><br>图片:<input type="text"  value=""  name="data['+i+'][img]"  size="40"   id="UP_'+i+'.img"><br/><iframe name="MF_'+i+'.img"  frameborder=""  height="150"  scrolling="no"  width="370"  src="?app=vote&act=upfile&tf=pic&jsfun=UPF_upfile&putid=UP_'+i+'.img&id=&picurl=&edit=edit" ></iframe>';
	}
	document.getElementById('morevote').innerHTML+=str;
}
//-->
</SCRIPT>
                             
<SCRIPT LANGUAGE="JavaScript">
<!--
function choosetpl(t){
	if(t=='0'){
		document.getElementById('votetpl').value='{$votetpl0}';
	}else if(t=='1'){
		document.getElementById('votetpl').value='{$votetpl1}';
	}else if(t=='2'){
		document.getElementById('votetpl').value='{$votetpl2}';
	}
}
//-->
</SCRIPT>
  <SCRIPT LANGUAGE="JavaScript">
<!--
function JM_cc(ob){
var obj=document.getElementById(ob); if (obj) { 
obj.select();js=obj.createTextRange();js.execCommand("Copy");}
}
//-->
</SCRIPT>                              

                 </div>

</div>



<!--{inc(footer.view.html)}-->